package com.shop.enumeration;

/**
 * 
 * @author wenjuanhenxing
 * @version V1.0 ConditionParam.java 2016-4-2 上午9:45:39
 */
public enum ConditionParam {
	PRICE_ASC("01", "price_asc", "价格升序"), PRICE_DESC("02", "price_desc", "价格降序"), PRICE_BETWEEN(
			"03", "price_between", "价格区间"), DEGREE_10("05", "degree_10", "全新"), DEGREE_9(
			"05", "degree_9", "9成新以上"), DEGREE_8("05", "degree_8", "8成新以上"), DEGREE_7(
			"05", "degree_7", "7成新以上"), DEGREE_6("05", "degree_6", "6成新以下"), HOT(
			"04", "hot", "人气热门"), RECENT("06", "recent", "最新上架"), ONLINE("07",
			"online", "在线交易"), OFFLINE("08", "offline", "线下交易");

	private String id;
	private String code;
	private String message;

	ConditionParam(String id, String code, String message) {
		this.id = id;
		this.code = code;
		this.message = message;
	}

	public String getId() {
		return id;
	}

	public String getMessage() {
		return message;
	}

	public String getCode() {
		return code;
	}

	public static ConditionParam getConditionParamByCode(String code) {
		for (ConditionParam conditionParam : ConditionParam.values()) {
			if (conditionParam.getCode().equalsIgnoreCase(code)) {
				return conditionParam;
			}
		}
		return null;
	}
}
